package com.fansl.allround.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author fansl
 * @Description: 用户类型
 * @date 2019/10/10 12:41
 */
@Getter
@AllArgsConstructor
public enum UserTypeEnum {
    SYS(1,"系统用户"),
    UCENTER(2,"用户");

    /**
     * 类型
     */
    private final int code;
    /**
     * 描述
     */
    private final String description;

    public static UserTypeEnum getByCode(int code){
        for (UserTypeEnum value:UserTypeEnum.values()){
            if(value.getCode()==code){
                return value;
            }
        }
        return UCENTER;
    }
}
